package cn.water.spring.boot.starter.config;

import cn.water.spring.boot.starter.bean.LuBanUser;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(value = "luban.user.name")
public class LuBanUserAutoConfiguration {
    @Value("${luban.user.name}")
    private String name;
    @Bean
    @ConditionalOnProperty(value = "luban.user.enable",havingValue = "true")
    public LuBanUser luBanUser(){
        return new LuBanUser(name);
    }
}
